package ball.sneaker.Server;

import com.sun.net.httpserver.HttpsConfigurator;
import com.sun.net.httpserver.HttpsParameters;
import java.net.InetSocketAddress;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLParameters;

/**
 *
 * @author Arthur
 */
public class MyHttpsConfigurator extends HttpsConfigurator {

    public MyHttpsConfigurator(SSLContext sslc) {
        super(sslc);
    }

    @Override
    public void configure(HttpsParameters params) {

        // get the remote address if needed
        InetSocketAddress remote = params.getClientAddress();

        SSLContext c = getSSLContext();

        // get the default parameters
        SSLParameters sslparams = c.getDefaultSSLParameters();
//        if (remote.equals (...) ) {
//            // modify the default set for client x
//        }
        params.setSSLParameters(sslparams);
        // statement above could throw IAE if any params invalid.
        // eg. if app has a UI and parameters supplied by a user.

    }
}
